package effective.java.item59;

import java.util.SplittableRandom;

public class SplittableRandomExample {
    public static void main(String[] args) {
        SplittableRandom splittableRandom = new SplittableRandom();
        int randomNumber = splittableRandom.nextInt(0, 100); // 生成0到99之间的随机整数

        // 创建一个新的独立的随机数生成器
        SplittableRandom newSplittableRandom = splittableRandom.split();

        System.out.println("Original random number: " + randomNumber);
        System.out.println("New random number from split: " + newSplittableRandom.nextInt(0, 100));
    }
}
